#ifndef PROJECT_H
	#define PROJECT_H
	#include "A3_1.h"
#endif
//Skeleton requires:
//Spine
// - neck
// - shoulder joint
// - pelvis joint
//left arm
// - left bicep
// - left elbow
// - left forearm
//right arm
// - right bicep
// - right elbow
// - right forearm
// pelvis
// - spinal joint
// - Left pelvis joint
// - Right pelvis joint
// left leg
//right leg


// Normally I would like each individual part of the model to be centered, but I wantconstruction to be easy, so the origin of each part is 
// the top
// Arm movement: the left and right arms are going to be curvy, if time permitted and sway back and forth as the gum drop moves forward
// Leg movement: The leg will rigidly lift off the ground, because there is no knee joint and swing forward, pivoting on the grounded 
//rotating the body by 45 degrees (maybe less).

//For classes:
// it would be a good idea to have the entire model scaleable for now instead of manipulating attributes
// constructor GumdropSkeleton (scale)
/*
	spine[0][] position of tip
	spine[1][] position of shoulder joint
	spine[2][] position of pelvis joint 
	*/
	/*
	leftArm[0][] position of left bicep
	leftArm[1][] position of left elbow
	leftArm[2][] position of left forearm
	*/	/*
	rightArm[0][] is position of rigt bicep
	rightArm[1][] position of right elbow joint
	rightArm[2][] position of right forearm
	*/
	/*
	pelvis[0][] position of left leg joint
	pelvis[1][] position of spinal joint
	pelvis[2][] position of right leg joint
	*/
	/*
	leftLeg[0][] position of pelvis joint
	leftLeg[1][] position of foot
	*/
	/*
	rightLeg[0][] position of pelvis joint
	rightLeg[1][] position of foot
	*/
class GumdropSkeleton
{
private:
	GLfloat spine[3][3];
	GLfloat shoulders[3][3];
	GLfloat leftArm[3][3];
	GLfloat rightArm[3][3];
	GLfloat pelvis[3][3];
	GLfloat leftLeg[2][3];
	GLfloat rightLeg[2][3];
	GLfloat coneWaterLevel;
	GLfloat baseRadius;
	GLfloat topRadius;
	GLfloat height;
	GLfloat sphereRadius;

	//Initialize the body parts of the skeleton
	void LoadWater();
	void LoadSpine();
	void LoadShoulders();
	void LoadLeftArm();
	void LoadRightArm();
	void LoadPelvis();
	void LoadLeftLeg();
	void LoadRightLeg();
	
	//Update the body parts of the skeleton
	void UpdateSpine(GLfloat value);
	void UpdateShoulders(GLfloat value);
	void UpdateLeftArm(GLfloat value);
	void UpdateRightArm(GLfloat value);
	void UpdatePelvis(GLfloat value);
	void UpdateLeftLeg(GLfloat value);
	void UpdateRightLeg(GLfloat value);

	//Draw the body parts of the skeleton
	void drawCylinder(GLfloat baseRadius, GLfloat topRadius, GLfloat height);
	void DrawWater();
	void DrawSpine();
	void DrawShoulders();
	void DrawLeftArm();
	void DrawRightArm();
	void DrawPelvis();
	void DrawLeftLeg();
	void DrawRightLeg();


	//Movement Actions
	void LiftLeftLeg(GLint milliseconds);
	void MoveLeftLegForward(GLint milliseconds);
	void DropLeftLeg(GLint milliseconds);

	void LiftRightLeg(GLint milliseconds);
	void MoveRightLegForward(GLint milliseconds);
	void DropRightLeg(GLint milliseconds);

public:
	//Initialize the skeleton
	void LoadGumdropSkeleton();

	//Update the skeleton
	void UpdateGumdropSkeleton();

	//Draw the skeleton
	void DrawGumdropSkeleton();

	//Walking animation
	void PlayWalkingAnimation();

	void SetConeWaterLevel(GLfloat l);
	void SetConeTopRadius(GLfloat t);

	GLfloat GetRootBoneX();
	GLfloat GetRootBoneY();
	GLfloat GetRootBoneZ();
};


